/********************************************************************************
 *      Copyright:  (C) 2025 LingYun IoT System Studio
 *                  All rights reserved.
 *
 *       Filename:  logger.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(06/04/25)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "06/04/25 18:03:07"
 *                 
 ********************************************************************************/
#ifndef _LOGGER_H_
#define _LOGGER_H_

#include <stdio.h>
#include <error.h>
#include <errno.h>
#include <time.h>
#include <stdarg.h>
#include <string.h>
#include "logger.h"

/* logger level*/
enum
{
	LOG_LEVEL_CRITICAL,
	LOG_LEVEL_ERROR,
	LOG_LEVEL_WARNING,
	LOG_LEVEL_INFO,
	LOG_LEVEL_DEBUG,
	LOG_LEVEL_MAX,
};

#define LOG_STRING_CRITICAL	"CRITICAL"
#define LOG_STRING_ERROR 	"ERROR"
#define LOG_STRING_WARNING 	"WARNING"
#define LOG_STRING_INFO		"INFO"
#define LOG_STRING_DEBUG	"DEBUG"

int logger_init(char *fliename,int loglevel);
void logger_term(void);

/* logging methods by level*/
void log_critical(char *format,...);
void log_error(char *format,...);
void log_warning(char *format,...);
void log_info(char *format,...);
void log_debug(char *format,...);

#endif

